#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QAbstractSocket>
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QHostAddress>
#include <QMetaType>
#include <QStandardPaths>
#include <QString>
#include <QTcpSocket>

class TCPPLCClient : public QObject
{
    Q_OBJECT

public:
    explicit TCPPLCClient(QWidget *parent = nullptr);
    ~TCPPLCClient();

signals:
    // 从PLC服务器接收一个新的座椅检测请求，
    void newSeatMessage(QString,QString,QString);

public:
    void sendRawMessage(QString str);

private:
    void Init();

public:
    void ConnectServer(QString strIP, int port);

private slots:
    void readSocket();
    void discardSocket();
    void displayError(QAbstractSocket::SocketError socketError);

private:
    QTcpSocket *socket;
};

#endif // TCPCLIENT_H
